<?php
$cat = new Admin_Models_Category();
?>
<form name="" action="<?php echo URL_BASE . '/admin/product/insertPro'; ?>" method="post" class="frm" enctype="multipart/form-data">
    <div class="info">
        <p>
            <label>Name:</label>
            <input type="text" name="txtName" id="" />
        </p>
        <p>
            <label>Thumb:</label>
            <input type="file" name="fThumb" id="" style="vertical-align: bottom;" />
        </p>
        <p>
            <label>Images Gallery:</label>
            <input type="file" name="fImages[]" id="" style="vertical-align: bottom;" multiple />
        </p>
        <p>
            <label>Category:</label>
            <select name="sltCatId">
                <?php
                foreach ($cat->getParentCat() as $c) {
                    ?>
                    <option value="<?php echo $c->getCatId(); ?>"><?php echo $c->getName(); ?></option>
                    <?php
                    foreach ($cat->getChildCat($c->getCatId()) as $cc) {
                        ?>
                        <option value="<?php echo $cc->getCatId(); ?>"><?php echo "... " . $cc->getName(); ?></option>
                        <?php
                    }
                }
                ?>
            </select>
        </p>
        <p>
            <label>Description:</label>
            <textarea id="editor1" name="txtDescription"></textarea>
        </p>
        <script type="text/javascript">
            var editor = CKEDITOR.replace('editor1', {
                filebrowserBrowseUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/ckfinder.html',
                filebrowserImageBrowseUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/ckfinder.html?type=Images',
                filebrowserFlashBrowseUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/ckfinder.html?type=Flash',
                filebrowserUploadUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                filebrowserImageUploadUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                filebrowserFlashUploadUrl: 'http://localhost/gsmvc/public/templates/admin/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
                width: 600, height: 250
            });
            CKFinder.setupCKEditor(editor, '../');
        </script>
        <p>
            <label>Price (VNĐ):</label>
            <input type="text" name="txtPrice" id="" />
        </p>
        <p>
            <label>Status:</label>
            <select name="sltStatus">
                <option value="0">Hết hàng</option>
                <option value="1">Còn hàng</option>
            </select>
        </p>
        <p>

        </p>
        <p>
            <label></label>
            <input type="submit" value="Thêm" id="" />
        </p>
    </div>
</form>